﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace Freejobber.Core.Generic.Helpers
{
    public class IpGeoLocation
    {
        public static string GetLocationByIp(string ipAdress)
        {
            string result = "";
            XmlDocument doc = new XmlDocument();
            doc.Load(string.Format("{0}{1}", ConfigManager.IpGeoLocationURL, ipAdress));
            XmlNodeList urls = doc.SelectNodes("ip-answer/ip/city");
            foreach (XmlNode url in urls)
                result = url.InnerText;
            return result;
        }
    }
}
